﻿@model IEnumerable<CmsModule>

@{
    ResFile = "cms_Pages";
}

@if (Model.Any())
{
<ol class="b-form__rows ul-reset g-clear">
    @foreach (var item in Model)
    {
    <li class="b-form__row g-clear">
        <a class="addPageModule" rel="@ViewBag.PageId/@ViewBag.CurrentTemplateRegion" href="@Url.Action("addmodule", "cmspage")/@item.Id/@ViewBag.PageId/@ViewBag.CurrentTemplateRegion">@item.ModuleName</a>        
        <div class="js-admin-caption b-admin-caption" style="display: none;">
            <div class="b-admin-caption__edit">
                <span class="b-admin-caption__edit__title">@_("Caption"):</span>
                <input type="text" name="caption" class="text js-admin-caption-text"/>
            </div>
            <button class="js-add-page-module b-button b-button_small">@_("Next")</button>
            <button class="b-button b-button_small b-button_colour_grey" onclick="$(this).closest('.js-admin-caption').hide();return false;">@_("Cancel")</button>
        </div>
    </li>
    }
</ol>
}
else
{ 
    <p>@_("No modules exist")</p>
}